import { hyRequest } from '..'
import type { IAccount } from '@/types'
// import { localCache } from '@/utils/cache'
// import { LOGIN_TOKEN } from '@/global/constants'

export function accountLoginRequest(account: IAccount) {
  return hyRequest.post({
    url: '/AccAdmin/doLogin',
    data: account
  })
}

/**
 * 注销
 * @returns
 */
 export function accountLogOutRequest() {
  return hyRequest.post({
    url: '/AccAdmin/doExit'
  })
}

// export function getUserInfoById(id: number) {
//   return hyRequest.get({
//     url: `/users/${id}`
//     // headers: {
//     //   Authorization: 'Bearer ' + localCache.getCache(LOGIN_TOKEN)
//     // }
//   })
// }
/**
 * 根据用户角色id返回菜单信息
 * @param id 角色id
 * @returns
 */
export function getUserMenusByRoleId(id: number) {
  return hyRequest.get({
    url: `/role/${id}/menu`
  })
}
